<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>get</title>
</head>
<div>11</div>

<body>
  <script>
    let xhr = new XMLHttpRequest();
    xhr.onreadystatechange = () => {
      console.log('onreadystatechange', xhr.readyState);
    }
    xhr.open("GET", "http://localhost:5555/get");
    xhr.responseType = "text";
    xhr.setRequestHeader('name', 'zhufeng');
    xhr.setRequestHeader('age', '10');
    xhr.onload = () => {
      console.log('readyState', xhr.readyState);
      console.log('status', xhr.status);
      console.log('statusText', xhr.statusText);
      console.log('getAllResponseHeaders', xhr.getAllResponseHeaders());
      console.log('response', xhr.response);
    };
    xhr.send();
  </script>
</body>

</html>